<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>修改密码</title>
<script type="text/javascript">
Ext.onReady(function() {
	Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
	
 // 编辑用户Form
	var changePwdFormPanel = Ext.create('Ext.form.Panel',{
		renderTo: 'changePwdFormDiv',
        labelWidth: 60,
        border: false,
        bodyStyle: 'background-color:transparent;',
        url: '/',
        items: [{
            border: false,
            bodyStyle: 'padding:5px;background-color:transparent;',
            items:[{// 原密码
            	xtype:'textfield',
        		inputType: 'password',
                id: 'oldpassword',
                name: 'oldpassword',
                fieldLabel: '原密码',
                anchor:'95%',
                allowBlank:false,
                maxLength: 20
           },{// 新密码
        	   xtype:'textfield',
        	   inputType: 'password',
               id:'password',
               name:'password',
               fieldLabel:'新密码',
               anchor:'95%',
               allowBlank:false,
               maxLength: 20
           },{// 确认密码
        	   xtype:'textfield',
        	   inputType: 'password',
        	   id:'repassword',
               name:'repassword',
               fieldLabel:'确认密码',
               anchor:'95%',
               allowBlank:false,
               maxLength: 20
            }],

            // Reset and Submit buttons
            buttons: [{
                text: '重置',
                handler: function() {
                    this.up('form').getForm().reset();
                }
            }, 
            {
                text: '确定',   
                handler: function() {
                    var form = this.up('form').getForm();
                    if (form.isValid()) {
                    	// 发送请求
    					MyExt.ajaxRequest({
    						baseUrl: '',
    						baseParams: form.getValues(),
    						action: '../json/changePwd.jsp',
    						callback: function(jsonResult){
    							
    							Ext.state.Manager.set('Mynote_password', false);//取消记住密码
    							Ext.state.Manager.set('Mynote_autoLogin', false);//取消自动登录
    							location.href="../index.html";
    						},
    						showWaiting: true,
    						showMsg: true,
    						successMsg: '密码修改成功，请重新登录！'
    					});
                    }
                }
            }]
        }]
    });

});


</script>

</head>
<body>
<div id="changePwdDiv" style="width:100%;height:100%;">
	
	<div id="changePwdFormDiv"></div>
</div>
</body>
</html>